﻿@using Ext.Net
@using Ext.Net.MVC
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>Trang quản trị website Ungthuvn</title>
        <script src="/Scripts/extjs-utils.js" type="text/javascript"></script>
    </head>
<body>
    <div class="page" style="padding: 1px">
        @Html.X().ResourceManager().Theme(Theme.Default)
        @Html.X().Viewport().Layout("BorderLayout").Items(
            Html.X().Panel().Region(Region.West).Split(true).Title("Menu").Border(false).Width(width: 200).Header(false).Collapsed(false)
                .Items(
                    Html.X().Panel().Layout(LayoutType.Accordion).Items(
                        Html.X().MenuPanel().ID("MenuHome").Icon(Icon.House).Title((Membership.GetUser() != null ? "Xin chào:    <b>" + Membership.GetUser().UserName + "</b>" : "Home")).Menu(menu =>
                                                      {
                                                          if (User.IsInRole("administrators"))
                                                          {
                                                              menu.Items.Add(Html.X().MenuItem().Text("Danh sách tài khoản").Listeners(li => li.Click.Handler = "addTab(#{Pages}, 'Account', '/Account/ListAcount');").Icon(Icon.UserGo));
                                                          }
                                                          menu.Items.Add(Html.X().MenuItem().Text("Đổi mật khẩu").Listeners(li => li.Click.Handler = "addTab(#{Pages}, 'ChangePass', '/Account/ChangePassword');").Icon(Icon.UserAdd));
                                                          if (User.IsInRole("administrators"))
                                                          {
                                                              menu.Items.Add(Html.X().MenuItem().Text("Cấu hình").Icon(Icon.UserAdd));
                                                          }
                                                          menu.Items.Add(Html.X().MenuItem().Text("Thoát").Listeners(li => li.Click.Handler = "window.location = '/Account/LogOff'").Icon(Icon.ControlPowerBlue));
                                                      }),
                        Html.X().MenuPanel().ID("MenuNews").Icon(Icon.New).Title("Quản lý tin tức").Menu(menu =>
                                                      {
                                                          if (User.IsInRole("administrators"))
                                                          {
                                                              menu.Items.Add(Html.X().MenuItem().Text("Nhóm tin").Listeners(li => li.Click.Handler = "addTab(#{Pages}, 'GroupNews', '/GroupNews/ListGNews');").Icon(Icon.NewspaperAdd));
                                                          }
                                                          menu.Items.Add(Html.X().MenuItem().Text("Tin tức").Listeners(li => li.Click.Handler = "addTab(#{Pages}, 'News', '/News/ListNews');").Icon(Icon.NewBlue));
                                                      }),
                        Html.X().MenuPanel().Icon(Icon.TelevisionIn).Title("Quản lý Video").Menu(menu =>
                                                      {
                                                          if (User.IsInRole("administrators"))
                                                          {
                                                              menu.Items.Add(Html.X().MenuItem().Text("Nhóm Video").Listeners(li => li.Click.Handler = "addTab(#{Pages}, 'GroupVideo', '/GroupVideo/ListGVideo');").Icon(Icon.Images));
                                                          }
                                                          menu.Items.Add(Html.X().MenuItem().Text("Video").Listeners(li => li.Click.Handler = "addTab(#{Pages}, 'Video', '/Video/ListVideo');").Icon(Icon.ImageMagnify));
                                                      }),
                        Html.X().MenuPanel().Icon(Icon.TelevisionIn).Title("Quản lý Tài liệu").Menu(menu =>
                                                      {
                                                          if (User.IsInRole("administrators"))
                                                          {
                                                              menu.Items.Add(Html.X().MenuItem().Text("Nhóm tài liệu").Listeners(li => li.Click.Handler = "addTab(#{Pages}, 'DocumentType', '/DocumentType/ListDocumentType');").Icon(Icon.Images));
                                                          }
                                                          menu.Items.Add(Html.X().MenuItem().Text("Tài liệu").Listeners(li => li.Click.Handler = "addTab(#{Pages}, 'Document', '/Document/ListDocument');").Icon(Icon.ImageMagnify));
                                                      }),
                        Html.X().MenuPanel().Icon(Icon.Accept).Title("Tác vụ khác").Menu(menu =>
                                                      {
                                                          menu.Items.Add(Html.X().MenuItem().Text("Bệnh viện").Listeners(li => li.Click.Handler = "addTab(#{Pages}, 'Hospital', '/Hospital/ListHospital');").Icon(Icon.HouseStar));
                                                          menu.Items.Add(Html.X().MenuItem().Text("Bệnh ung thư").Listeners(li => li.Click.Handler = "addTab(#{Pages}, 'Cancer', '/Cancer/ListCancer');").Icon(Icon.Page));
                                                          menu.Items.Add(Html.X().MenuItem().Text("Hỏi đáp").Listeners(li => li.Click.Handler = "addTab(#{Pages}, 'Question', '/Question/ListQuestion');").Icon(Icon.PageRefresh));
                                                      })
                        )
                ),
            Html.X().Panel().Region(Region.Center).Title("Center").Header(false).Layout(LayoutType.Fit).Items(
            Html.X().TabPanel().ID("Pages").Plugins(plug=>plug.Add(new TabCloseMenu()))
                              .Items(Html.X().Panel().Title("Home").AutoScroll(false).Loader(Html.X().ComponentLoader().Url("/Admin/Home").Mode(LoadMode.Frame).LoadMask(mask=>mask.ShowMask=true)))
            ),
            Html.X().Panel().Layout(LayoutType.Absolute).Region(Region.North).Height(90).StyleSpec("color: blue").Items(
                                  Html.X().HyperLink().NavigateUrl("http://localhost:1344/").ImageUrl("../../Content/Image/banner.png").Text("Trang chủ").StyleSpec("Float: right").Width(100)
            )
            //Html.X().Panel().Region(Region.South).Items(Html.X().Label().Text("Thong tin lien he")).Height(55)
           )
    </div>
</body>
</html>
